/**
 * @projectName base-yl
 * @package com.base.yl.common.exception
 * @className com.base.yl.common.exception.RequestException
 */
package com.answer.wx.common.exception;

import com.answer.wx.common.enums.ErrorEnum;
import lombok.Getter;

/**
 * RequestException
 * @description 请求异常
 * @author answer_wx
 * @date 2022/8/4 16:57
 * @version 1.0
 */
public class RequestException extends RuntimeException {
    @Getter
    private int code;
    @Getter
    private String message;

    public RequestException(ErrorEnum codeEnum) {
        code = codeEnum.getCode();
        message = codeEnum.getMessage();
    }

    public RequestException(ErrorEnum codeEnum, String message) {
        this.code = codeEnum.getCode();
        this.message = message;
    }

    public RequestException(int code, String message) {
        this.code = code;
        this.message = message;
    }
}